CREATE TABLE [dbo].[tb_LicenciasHistoricastemp]
(
[idLicenciaHistorica] [int] NOT NULL IDENTITY(1, 1),
[Agente] [int] NOT NULL,
[Licencia] [int] NOT NULL,
[ConOSinGoce] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaAlta] [datetime] NULL,
[Baja] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaBaja] [datetime] NULL,
[Dias] [int] NULL,
[Funcion] [int] NULL,
[Organizacion] [int] NULL,
[Modalidad] [int] NULL,
[ClasificacionServCert] [int] NULL CONSTRAINT [DF_tb_LicenciasHistoricastemp_ClasificacionServCert] DEFAULT ((3)),
[Categoria] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Zona] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] ADD CONSTRAINT [PK_tb_LicenciasHistoricastemp] PRIMARY KEY CLUSTERED  ([idLicenciaHistorica]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricastemp_tb_Funciones] FOREIGN KEY ([Funcion]) REFERENCES [dbo].[tb_Funciones] ([idFuncion])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricastemp_tb_Licencias] FOREIGN KEY ([Licencia]) REFERENCES [dbo].[tb_Licencias] ([idLicencia])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricastemp_tb_ModalidadesEnsenanza] FOREIGN KEY ([Modalidad]) REFERENCES [dbo].[tb_ModalidadesEnsenanza] ([idModalidad])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_LicenciasHistoricastemp_tb_Organizaciones] FOREIGN KEY ([Organizacion]) REFERENCES [dbo].[tb_Organizaciones] ([idOrganizaciones])
GO
ALTER TABLE [dbo].[tb_LicenciasHistoricastemp] ADD CONSTRAINT [FK_tb_LicenciasHistoricastemp_tb_Zonas] FOREIGN KEY ([Zona]) REFERENCES [dbo].[tb_Zonas] ([idZona])
GO
